package sliver.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import sliver.dao.CustomDao;
import sliver.entity.Custom;

@Repository
public class CustomDaoImpl extends BaseDaoImpl<Custom> implements CustomDao{

	@Override
	public Custom findByAuth(String username, String password) {
		
		String queryString = "SELECT c FROM Custom c WHERE c.username = ? AND c.password = ?";
		
		List<Custom> customs = complexQuery(queryString, new Object[]{username, password});
		
		if(customs != null && customs.size() == 1)
			return customs.get(0);
		
		return null;
	}

}
